package cn.slg.module.system.dal.dataobject.state.functional;

import cn.slg.module.system.dal.dataobject.wujiang.WuJiangDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.lang.reflect.Method;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LianJiState extends FunctionalState {

    // 同类效果不叠加
    boolean canAdd = false;

    // 不可刷新（若武将已经存在连击状态，则本次施加状态将失效）。
    boolean canRefresh = false;

    // 连击
    String stateName = "连击";

    public static boolean canAddState(String stateName, WuJiangDO inflictor, WuJiangDO receiver, Method skill, String skillName, byte continueTimes) {
        boolean canAdd = true;

        for (FunctionalState functionalState : receiver.getFunctionalStates()) {
            if (functionalState.getStateName().equals("连击")) {
                // 不可叠加
                canAdd = false;
                // 也不可刷新
            }
        }
        return canAdd;
    }

}
